package com.sangfor.ssl.l3vpn.service;

import android.util.Pair;
import java.util.List;

/* loaded from: classes2.dex */
public class TunConfig {
    private static final int MTU = 1400;
    private static final String TAG = "TunnelConfig";
    private static final String VPN_SESSION = "Sangfor SSLVpn";
    public String virIp = null;
    public int mtu = MTU;
    public String description = VPN_SESSION;
    public List<String> dnsServer = null;
    public List<Pair<String, String>> routes = null;
    public LaunchMode launchMode = LaunchMode.LAUNCH_TYPE_LAST;
    public List<String> whiteList = null;
    public List<String> blackList = null;

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("virtual ip = " + this.virIp);
        sb.append("\n");
        sb.append("mtu = " + this.mtu);
        sb.append("\n");
        sb.append("session = " + this.description);
        sb.append("\n");
        sb.append("Dns Server:");
        sb.append("\n");
        int i = 0;
        int i2 = 0;
        while (true) {
            List<String> list = this.dnsServer;
            if (list == null || i2 >= list.size()) {
                break;
            }
            sb.append(this.dnsServer.get(i2));
            sb.append(",");
            i2++;
        }
        sb.append("\n");
        sb.append("Routes:");
        sb.append("\n");
        int i3 = 0;
        while (true) {
            List<Pair<String, String>> list2 = this.routes;
            if (list2 == null || i3 >= list2.size()) {
                break;
            }
            Pair<String, String> pair = this.routes.get(i3);
            sb.append("ip:");
            sb.append((String) pair.first);
            sb.append(":");
            sb.append((String) pair.second);
            sb.append(",");
            i3++;
        }
        sb.append("\n");
        if (this.launchMode == LaunchMode.NET_TYPE_ISOLATION) {
            sb.append("allowedAppliocation:");
            sb.append("\n");
            int i4 = 0;
            while (true) {
                List<String> list3 = this.whiteList;
                if (list3 == null || i4 >= list3.size()) {
                    break;
                }
                sb.append(this.whiteList.get(i4));
                sb.append(",");
                i4++;
            }
        }
        if (this.launchMode == LaunchMode.NET_TYPE_VPN) {
            sb.append("disallowedAppliocation:");
            sb.append("\n");
            while (true) {
                List<String> list4 = this.blackList;
                if (list4 == null || i >= list4.size()) {
                    break;
                }
                sb.append(this.blackList.get(i));
                sb.append(",");
                i++;
            }
        }
        return sb.toString();
    }

    public boolean isValid() {
        return (this.virIp == null || this.routes == null || this.description == null) ? false : true;
    }
}
